﻿using System;
using System.Collections.Generic;
using System.Text;
using PPAP.DAO;
using PPAP.Model.Entity;
using System.Data;

namespace PPAP.BO
{
    public class SupplierBO
    {
        SUPPLIERDAO dao = new SUPPLIERDAO();
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string USERNAME)
        {
            return dao.Exists(USERNAME);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(SUPPLIER model)
        {
            return dao.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(SUPPLIER model)
        {
            return dao.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public int Delete(string USERNAME)
        {
            return dao.Delete(USERNAME);
        }

        /// <summary>
        /// 删除供应商及其联系人
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteSupplier(int id)
        {
            return dao.DeleteSupplier(id);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SUPPLIER GetModel(string USERNAME)
        {
            return dao.GetModel(USERNAME);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dao.GetList(strWhere);
        }

    
    }
}
